<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" 
	template="/WEB-INF/templates/template.xhtml">
	
	
	<ui:define name="headIncludes">
		<f:event listener="#{perfilBean.initializeForm(param.perfilId)}" type="preRenderView"/>
	</ui:define>
	
	<ui:define name="pageName">#{perfilBean.acao}</ui:define>
	<ui:define name="buttons">
		<p:commandButton value="Salvar"	style="height:28px;" action="#{perfilBean.save}" update="@this" icon="ui-icon-disk"/>
		<p:commandButton value="Voltar" style="height:28px;" action="#{perfilBean.changeToList}" process="@this" icon="ui-icon-arrowreturnthick-1-w"/>		
	</ui:define>
	
	<ui:define name="content">	
		<p:panel>
			<div>
				<p:messages autoUpdate="true"/>
				<h:panelGrid columns="1" style="padding:5px;">
					<h:outputText value="Código" />
					<p:inputText style="width:100px;" disabled="true" value="#{perfilBean.currentPerfil.id}"/>
				</h:panelGrid>
				
				<h:panelGrid columns="1" style="padding:5px;">
					<h:outputText value="Perfil *" />
					<p:inputText style="width:250px;" value="#{perfilBean.currentPerfil.perfil}" required="true" requiredMessage="Informe o perfil." maxlength="30"/>
				</h:panelGrid>
		
				<h:panelGrid columns="1" style="padding:5px;">
					<h:outputText value="* Campos obrigatórios" />
				</h:panelGrid>
			</div>
		</p:panel>		
	</ui:define>
</ui:composition>